package com.zhaorujie.rpc.core;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author 赵汝杰
 * @version v1.0
 * @description RpcProperties
 * @date 2024/3/5
 **/
@ConfigurationProperties(prefix = "rpc.remote")
public class RpcProperties {

    /**
     * 注册中心地址
     */
    private String registerAddr = "127.0.0.1:8848";
    /**
     * 远程调用端口
     */
    private int port = 12589;
    /**
     * 系列化算法
     */
    private String serializeType = "hessian";
    /**
     * 注册中心地址
     */
    private String registryType = "nacos";
    /**
     * 核心线程数
     */
    private int corePoolSize = 16;
    /**
     * 最大线程数
     */
    private int maxPoolSize = 100;
    /**
     * 环境
     */
    private String env = "default";

    /**
     * 超时时间（毫秒） 1分钟
     */
    private long timeout = 1000 * 60;

    /**
     * 负载均衡方式
     */
    private String loadBalance = "random";

    public RpcProperties() {
    }

    public String getRegisterAddr() {
        return registerAddr;
    }

    public void setRegisterAddr(String registerAddr) {
        this.registerAddr = registerAddr;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getSerializeType() {
        return serializeType;
    }

    public void setSerializeType(String serializeType) {
        this.serializeType = serializeType;
    }

    public String getRegistryType() {
        return registryType;
    }

    public void setRegistryType(String registryType) {
        this.registryType = registryType;
    }

    public int getCorePoolSize() {
        return corePoolSize;
    }

    public void setCorePoolSize(int corePoolSize) {
        this.corePoolSize = corePoolSize;
    }

    public int getMaxPoolSize() {
        return maxPoolSize;
    }

    public void setMaxPoolSize(int maxPoolSize) {
        this.maxPoolSize = maxPoolSize;
    }

    public String getEnv() {
        return env;
    }

    public void setEnv(String env) {
        this.env = env;
    }

    public long getTimeout() {
        return timeout;
    }

    public void setTimeout(long timeout) {
        this.timeout = timeout;
    }

    public String getLoadBalance() {
        return loadBalance;
    }

    public void setLoadBalance(String loadBalance) {
        this.loadBalance = loadBalance;
    }
}
